@model OrchardCore.ContentFields.ViewModels.EditTimeFieldViewModel
@using OrchardCore.ContentFields.Settings;
@using OrchardCore.ContentManagement.Metadata.Models

@{
    var settings = Model.PartFieldDefinition.Settings.ToObject<TimeFieldSettings>();
}

@{
    // Morph the current shape to the correct editor shape based on its Editor property
    var shape = Model as OrchardCore.DisplayManagement.IShape;
    shape.Metadata.Alternates.Clear();
    shape.Metadata.Type = "TimeField_Editor";

    if (!String.IsNullOrEmpty(settings.Editor))
    {
        shape.Metadata.Alternates.Add($"TimeField_Editor__{settings.Editor}");
    }
}

@await DisplayAsync(Model)
